package cn.kgc.service.impl;

import cn.kgc.dao.PdmDao;
import cn.kgc.pojo.Branch;
import cn.kgc.pojo.Pdm;
import cn.kgc.pojo.position;
import cn.kgc.service.PdmService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: 王建恒
 * @date: 2022/2/16
 * @description:
 */
@Service
public class PdmServiceImpl  implements PdmService {

    @Resource
    private PdmDao pdmdao;


    @Override
    public Page<Pdm> selPdmQuanbu(String fileCoding, String checkStatus, String fstatus, String startDate, String endDate) {
        return pdmdao.selPdm(fileCoding, checkStatus, fstatus, startDate, endDate);
    }

    @Override
    public boolean addrenshi(Pdm pdm) {
        if(pdmdao.addrenshi(pdm)>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean delPdm(Integer id, String shann,String fstatus) {
        if(pdmdao.delPdm(id,shann,fstatus) > 0){
            return true;
        }
        return false;
    }



    /**
     * 变更审核
     * @param idd
     * @param bohui
     * @return
     */
    @Override
    public boolean biangengshenhe(Integer idd, String bohui) {
        if(pdmdao.biangengshenhe(idd, bohui) > 0){
            return true;
        }
        return false;
    }

    /**
     * 照片上传
     * @param id
     * @param phonePath
     * @return
     */
    @Override
    public boolean upshangchuan(Integer id, String phonePath) {
        if(pdmdao.upshangchuan(id, phonePath) < 0){
            return true;
        }
        return false;
    }

    @Override
    public List<Pdm> fuhPdm(Integer id) {
        return pdmdao.fuhdddPdm(id);
    }

    @Override
    public boolean fuhebohui(Integer idd, String bohui) {
        if(pdmdao.fuhebohui(idd,bohui) > 0){
            return true;
        }
        return false;
    }

    @Override
    public boolean fuhePdmbaocun(Pdm pdm) {
        if (pdmdao.fuhePdmbaocun(pdm) > 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean renshiyongjiushanchu(Integer id) {
        if (pdmdao.renshiyongjiushanchu(id) > 0){
            return true;
        }
        return false;
    }

    @Override
    public boolean renshidanganshanchuhuifu(Integer id) {
        if (pdmdao.renshidanganshanchuhuifu(id) > 0){
            return true;
        }
        return false;
    }

    /**
     * 修改人事
     *
     * @param id@return
     */
    @Override
    public Pdm updrenshi(Integer id) {
        return null;
    }

    @Override
    public Page<position> getBranchLists(String posName, String posCode, String brName) {
        return pdmdao.getBranchLists(posName,posCode,brName);
    }

    @Override
    public List<Branch> XiaLaKuangBranch() {
        return pdmdao.XiaLaKuangBranchs();
    }

    @Override
    public position getzhiwei(Integer id) {
        return pdmdao.getzhiwei(id);
    }

    @Override
    public Pdm selectById(Integer id) {
        return pdmdao.selectById(id);
    }

    @Override
    public boolean upd(Pdm pdm) {
        if (pdmdao.upd(pdm)>0){
            return true;
        }
        return false;

    }

    @Override
    public position getlists(String posName) {
        return pdmdao.getlists(posName);
    }

//    /**
//     * 查询全部职位
//     * @return
//     */
//    @Override
//    public List<position> selposition() {
//
//        return pdmdao.selposition();
//    }

}